﻿
<%


set conn=server.createobject("adodb.connection")
connstr="Driver={SQL Server};SERVER=N-SERVER\MSSQLSERVER2;UID=sa;Password=jckj2008;DATABASE=UnexDB2"
conn.open connstr
%>

<HTML>
<HEAD>
<TITLE>A M K E Y</TITLE>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<link href="../css/StyleSheet.css" rel="stylesheet" type="text/css">
<%=JSBkMenu_S%>
<SCRIPT language=JavaScript src="../menu/mmenu.js" type="text/javascript"></SCRIPT>

<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</HEAD>
<BODY BGCOLOR="WHITE" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0" MARGINHEIGHT="0">


<table width="823" border="0" cellspacing="0" cellpadding="1" align="left">

	
  <tr>   
  <td width="821" height=58 align=center valign=top>


        <form name="form1" method="post" action="inoutcheck.asp">
          <table width="99%" border="1" cellspacing="0" cellpadding="0">
            <tr> 
              <td align="right" bgcolor="#efefef">日期:&nbsp;</td>
			  <td align="left">&nbsp;
			  <input name="startDate" type="text" value="" size="20" maxlength="20">
			  格式(8/12/2011)</td>
              <td align="left">跟踪号</td>
              <td align="left"><input name="trackingno" type="text" size="25" maxlength="25"></td>
              <td align="right" bgcolor="#efefef">帐号:&nbsp;</td>
			  <td align="left">&nbsp;
			  <input name="SNID" type="text" size="10" maxlength="10">			  </td>	
   			  <td rowspan="2" align="center"><input type="submit" name="Submit" value="Search"></td>				
		    </tr>
			  <tr>
              <td align="right" bgcolor="#efefef">&nbsp;</td>
			  <td colspan="3" align="left">&nbsp;</td>			  
              <td align="right" bgcolor="#efefef">&nbsp;</td>
			  <td align="left">&nbsp;</td>	
             </tr>
          </table>
        </form>
	</td>
  </tr>
              
	  <tr>
     	<td colspan="4">
      	<TABLE width="99%" border="0" align="center" cellpadding="1" cellspacing="1">
		<%
		%>            
        <tr bgcolor="#969ac2">
          <td  height="21" colspan="8" align="center"><span class="style1">进货导入报表</span></td>
          </tr>
        <tr bgcolor="#969ac2"> 
          <td width="6%"  height="21" align="center"><font color="#FFFFFF">帐号</font></td>
          <td width="10%"  align="center"><span class="style1">跟踪号码</span></td>
          <td width="10%"  align="center"><font color="#FFFFFF">日期</font></td>
          <td width="8%"><div align="center"><font color="#FFFFFF">重量(磅)</font></div></td>
          <td width="9%" align="center"><span class="style1">运输公司</span></td>
          <td width="4%" align="center">修改</td>
        <td width="2%" align="center">&nbsp;</td>
        <td width="2%" align="center">&nbsp;</td>
        </tr>
<%
	maxmessage=15
	PageNo = request("PageNo")
	if PageNo = "" or CInt(PageNo) < 1 then PageNo = 1
	
	
	if request("Submit")="Search"  or request("id")<>"" then 
		
		strSQL=" SELECT top 10000 * from inShip where 1=1"

			if request("startDate")<>"" then
				strSQL=strSQL & " and  date='"&request("startDate")&"'"
			end if
			
			if request("SNID")<>"" then
				strSQL=strSQL & " and  AccountNo='"&request("SNID")&"'"
			end if

			if request("id")<>"" then
				strSQL=strSQL & " and  id='"&request("id")&"'"
			end if
			
			if request("trackingno")<>"" then
				strSQL=strSQL & " and  trackingno='"&request("trackingno")&"'"
			end if


		strSQL=strSQL & " Order by id desc"
		set rs=server.CreateObject("adodb.recordset")
		rs.open strSQL,connstr,1,1
		if not rs.eof then
		
		rs.pagesize=maxmessage
		PageCount = rs.PageCount

		if CInt(PageNo) > PageCount then PageNo = PageCount
			rs.absolutepage = PageNo
			Rec_Total=rs.RecordCount
			n=0
			while not rs.eof and n < rs.pagesize
			n=n+1	

	%>
        <tr align="center" bgcolor="#efefef"> 
          <td><%=rs("AccountNo")%></td>
      <% if rs("company")="USPS" then%>      <td><a href="http://www.usps.com/shipping/trackandconfirm.htm?from=global_header&page=trackandconfirm&id=<%=rs("trackingno")%>" target="_blank"><%=rs("trackingno")%></a></td>  
      <% elseif rs("company")="ONTRAC" then%> <td><a href="https://www.ontrac.com/tracking.asp?id=<%=rs("trackingno")%>" target="_blank"><%=rs("trackingno")%></a></td>  <% elseif rs("company")="UPS" then%> <td><a href="http://www.ups.com/WebTracking/track?loc=en_US&WT.svl=PriNav&id=<%=rs("trackingno")%>" target="_blank"><%=rs("trackingno")%></a></td><% else%> <td><a href="http://www.fedex.com/Tracking?cntry_code=cn&id==<%=rs("trackingno")%>" target="_blank"><%=rs("trackingno")%></a></td>  <% end if%>
            <td><%=rs("date")%> </td>
          <td><%=rs("weight")%></td>
          <td><%=rs("company")%></td>
          <td> <a href="Edit.asp?id=<%=rs("id")%>&AccountNo=<%=rs("AccountNo")%>">Edit</a> </td>
        <td><a href="addinship.asp">add</a></td>
        <td><a href="delinship.asp?id=<%=rs("id")%>">delete</a></td>
        </tr>
    <%
	rs.movenext
	wend
	%>
        <tr> 
          <td colspan=8> <div align="center">Page <%=PageNo%> of <%=PageCount%>&nbsp;&nbsp;Current Page:
              <%
		for i=1 to PageCount
			if cint(PageNo)=cint(i) then
				response.write "&nbsp;&nbsp;<b>"&i&"</b>"
			else
		%>
                 &nbsp;&nbsp; <a href="inoutcheck.asp?submit=Search&PageNo=<%=i%>&PT=<%=request("PT")%>&startdate=<%=request("startdate")%>&snid=<%=request("snid")%>"><%=i%></a>  
              <%
			end if
		next
 end if
 rs.close
 end if %>
            
		  </td>
        </tr>
      </TABLE>
	</td>			
  </tr>

  <tr>

  </tr> 

</table>

</BODY>
</HTML>